package com.sntk.registermanager.staff.domain.model;

/**
 * 性别
 */
public enum Gender {

    Man("男", 1), WOMAN("女", 0);

    // 成员变量
    private String name;
    private int index;
    // 构造方法
    private Gender(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static Gender get(int index) {
        for (Gender c : Gender.values()) {
            if (c.getIndex() == index) {
                return c;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
